package sk.tuke.client.view;

import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VLayout;

import sk.tuke.client.ApplicationClickHandler;
import sk.tuke.client.areas.ApplicationMenuArea;
import sk.tuke.client.areas.ContextArea;
import sk.tuke.client.areas.HeadArea;
import sk.tuke.client.areas.NavigationMenuArea;
import sk.tuke.client.areas.WidgetArea;
import sk.tuke.client.interfaces.LayoutFactory;
import sk.tuke.client.interfaces.InitInterface;

public class DoctorView extends VLayout implements InitInterface {

	private ApplicationMenuArea applicationMenu;

	public DoctorView() {
		VLayout vLayout = new VLayout();
		vLayout.addMember(new HeadArea());

		applicationMenu = new ApplicationMenuArea(30);
		applicationMenu.addSimpleMenu("<u>D</u>ashboard", 70, 30, 0, new DashboardView.Factory(), new ApplicationClickHandler());
		applicationMenu.addSimpleMenu("<u>P</u>atients", 55, 30, 1, new PatientsListView.Factory(), new ApplicationClickHandler());
		applicationMenu.addSimpleMenu("<u>C</u>alendar", 60, 30, 2, new PatientsListView.Factory(), new ApplicationClickHandler());
		applicationMenu.addSimpleMenu("Pro<u>f</u>ile", 45, 30, 3, new ProfileView.Factory(), new ApplicationClickHandler());
		applicationMenu.addSimpleMenu("<u>S</u>ign out", 55, 30, 4, new PatientsListView.Factory(), new ApplicationClickHandler());

		vLayout.addMember(applicationMenu);
		vLayout.addMember(new NavigationMenuArea());

		northLayout.setMembers(vLayout);

		westLayout.setMembers(new WidgetArea());

		eastLayout.setMembers(new ContextArea());

		southLayout.setMembers(eastLayout, westLayout);
		mainLayout.setMembers(northLayout, southLayout);

	}

	public static class Factory implements LayoutFactory {

		public Canvas create() {
			return new DoctorView();
		}
	}

}
